package com.example.juc;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

public class CountDownLatchTest {
    public static void main(String[] args) throws InterruptedException {
        CountDownLatch countDownLatch = new CountDownLatch(3);
        for (int i = 0; i < 3; i++) {
            countDownLatch.countDown();
            System.out.println(countDownLatch.getCount());
        }
        countDownLatch.await();
        System.out.println("执行操作");
    }
}
